/*
* Copyright (c) 2015 elion. All Rights Reserved.
*/
package com.guoyu.project.common.utils.http;

import java.io.IOException;
import java.security.cert.X509Certificate;

import javax.net.ssl.SSLException;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocket;

import org.apache.http.conn.ssl.X509HostnameVerifier;

/**
 * 创建HostnameVerifier
 * 用于解决javax.net.ssl.SSLException: hostname in certificate didn't match:
 *
 * @author: xblibo  Date: 15-06-04 Time: 下午12:44
 */
public class TrustAnyHostnameVerifier implements X509HostnameVerifier {

	@Override
	public void verify(String host, SSLSocket ssl) throws IOException {
	}

	@Override
	public void verify(String host, X509Certificate cert) throws SSLException {
	}

	@Override
	public void verify(String host, String[] cns, String[] subjectAlts) throws SSLException {
	}

	@Override
	public boolean verify(String arg0, SSLSession arg1) {
		return true;
	}
}
